package com.service.pjsh;

import com.bpms.common.CommonUtil;
import com.bpms.common.JdbcWorker;
import com.bpms.common.VO;
import com.bpms.common.VOL;
import com.bpms.common.VOList;
import com.bpms.esb.IService;

public class Billmodify implements IService {
	public VO exec(VO arg0) {	
		VO r = new VO();
		try{			
			JdbcWorker j = new JdbcWorker();
			if("status".equals(arg0.getAttr("type")))
			{
				VO k = new VO();
				k.voType = "CM_DJB";
				k.keyString = "INSTANCEID";
				k.setAttr("INSTANCEID",arg0.getAttr("INSTANCEID"));
				VO u = new VO();
				u.setAttr("STATUS", arg0.getAttr("STATUS"));			
				j.update(u,k);
			}else if("modify".equals(arg0.getAttr("type"))){
				VO k = new VO();
				k.voType = "CM_DJB";
				k.keyString = "INSTANCEID";
				k.setAttr("INSTANCEID",arg0.getAttr("INSTANCEID"));
				VO u = new VO();
				u.setAttr("PAYEENAME",arg0.getAttr("PAYEENAME"));
				u.setAttr("PAYEEBANK",arg0.getAttr("PAYEEBANK"));
				u.setAttr("DRAWEENAME",arg0.getAttr("DRAWEENAME"));
				u.setAttr("DRAWEEBANK",arg0.getAttr("DRAWEEBANK"));
				u.setAttr("AMOUNT", arg0.getAttr("AMOUNT"));	
				u.setAttr("ISSUEDATE", arg0.getAttr("ISSUEDATE"));
				u.setAttr("DRAWEEACCNO", arg0.getAttr("DRAWEEACCNO"));
				u.setAttr("PAYEEACCNO", arg0.getAttr("PAYEEACCNO"));
				u.setAttr("PASSWORD", arg0.getAttr("PASSWORD"));
				u.setAttr("USAGE", arg0.getAttr("USAGE"));
				u.setAttr("EXCHANGEBANKNO", arg0.getAttr("EXCHANGEBANKNO"));
				u.setAttr("BILLNO", arg0.getAttr("BILLNO"));
				j.update(u,k);
			}else if("rzhd".equals(arg0.getAttr("type")))
			{				
				String where =  arg0.getAttr("WHERE");
				String rzhd = arg0.getAttr("RZHD");
				String sql ="update cm_djb set RZHD='" + rzhd + "' where " + where;
				j.execute(sql);
			}
			else if("jzpz".equals(arg0.getAttr("type")))
			{
				String where =  arg0.getAttr("WHERE");
				String rzhd = arg0.getAttr("JZPZ");
				String sql ="update cm_djb set JZPZ='" + rzhd + "' where " + where;
				j.execute(sql);
			}
			r.setAttr("ret","1");
			r.setAttr("msg","操作已成功");
		}catch(Exception e){
			CommonUtil.debug("ShowImage.showpic exception", e);
			r.setAttr("ret","0");
			r.setAttr("msg","操作失败");
		}
		return r;
	}
}
